package cn.you.GenghisKhan;

import cn.you.GenghisKhan.common.jdbc.JDBCMySql;
import cn.you.GenghisKhan.config.utils.GlobalConfig;
import cn.you.GenghisKhan.db.relation.bean.DatabaseBean;

public class App {
    public static void main (String[] args) throws Exception {
        GlobalConfig.getConfig("mysql.url");
        JDBCMySql jdbcMySql=new JDBCMySql("jdbc:mysql://127.0.0.1:3306/config_centare?user=root&password=&allowMultiQueries=true");
        String sql="select app_name as appName ,tomcat_port as tomcatPort,tomcat_maxConnections as tomcatMaxconnections,tomcat_acceptCount as tomcatAcceptcount,\n" +
                "tomcat_maxThreads as tomcatMaxthreads,tomcat_minSpareThreads as tomcatMinsparethreads,tomcat_connectionTimeout as tomcatConnectiontimeout\n" +
                " from service where app_name='cn.centaur.open.rest'";
   //     AppBean aa=jdbcMySql.getObject(AppBean.class,sql);


         sql="select name,db_type as dbType,host,port,username,`password`,initialSize,maxActive,minIdle,maxWait from relation ";
        DatabaseBean databaseBean=null;
        try {
            databaseBean = jdbcMySql.getObject(DatabaseBean.class,sql);
        } catch (Exception e) {
            //logger.error("配置中心（Mysql）读取DatabaseBean异常:{}",e.getMessage());
        }
        System.out.println(databaseBean);
        //return databaseBean;


    }
}
